4 //==========================================================
\r
5 // Core of the animation system
\r
7 // If animation changed, change to the new parameters...
\r
8 if (animation != animations_old)
\r
10 animations_framemin = ani_framemin[animation];
\r
11 animations_framemax = ani_framemax[animation];
\r
12 animations_return = ani_return[animation];
\r
13 animations_speed = ani_speed[animation];
\r
15 animations_frame = animations_framemin;
\r
16 animations_timer = 0;
\r
17 animations_old = animation;
\r
21 animations_timer += animations_speed
\r
23 if (animations_timer >= 100) // Check if we are ready to change of frame
\r
25 animations_timer = 0;
\r
26 animations_frame += 1;
\r
28 if (animations_frame > animations_framemax)
\r
30 animations_frame = animations_return;
\r
35 draw_sprite_ext(sprite_index, animations_frame, x, y, image_xscale, image_yscale, 0, c_white, 1);
\r